import path = require("path")
import { start as startAdmin } from "maishu-admin";


export function start(config: { port: number, gateway: string, node_modules: string }) {

    startAdmin({
        port: config.port,
        staticRootDirectory: path.join(__dirname, "../client"),
        gateway: config.gateway,
        virtualPaths: {
            node_modules: config.node_modules,
            "lib": path.join(__dirname, "../client/lib"),
            "user/lib": path.join(__dirname, "../client/lib"),
            "admin/components": path.join(__dirname, "../client/components"),
            "user/components": path.join(__dirname, "../client/components"),
            // "components": path.join(__dirname, "../client/componets"),
        }
    })
}


// startFrontend({
//     port: 4682,
//     controllerPath: path.join(__dirname, "./frontend/server/controllers"),
//     staticRootDirectory: path.join(__dirname, "./frontend/www"),
//     gateway: `http://127.0.0.1:${config.nodeAuth.port}/auth`,
//     // proxy: config.frontend.proxy,
//     bindIP: config.frontend.bindIP,
//     virtualPaths: {
//         "node_modules": path.join(__dirname, "../node_modules")
//     }
// })
